home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.sources.wanted,comp.lang.c,comp.unix.programmer
- Subject: Re: Seek unix2dos.c OR help with tr
- Date: 15 Mar 96 02:37:09 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.826857429@rscernix>
- References: <4i0946$7io@nuke.csu.net> <danpop.826545577@rscernix> <4i9dj4INN7kl@keats.ugrad.cs.ubc.ca>
- NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <4i9dj4INN7kl@keats.ugrad.cs.ubc.ca> c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku) writes:
-
- >When I know that I'm specifically dealing with ASCII control chars, I have a
- >macro like:
- >
- >#define CTRL(C) ((C)-64)
-
- I'd define it like this:
-
- #define CTRL(C) ((C) & 0x1F)
-
- >which I then use with capital letters:
-
- which can be used with both lower and upper case letters.
-
- My preference for the '&' operator is probably related to the fact that
- I had to repair broken keyboards (amongst many other pieces of hardware)
- in a previous life, and this is how the CTRL key logic was implemented on
- those keyboards :-)
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-